<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="edge" />
<link rel="shortcut icon" href="/style/images/index/favicon.png" />
<script type="text/javascript">

    $(function() {
        $('#modelForm').on('submit', function(event){
            var $form = $(this);
            progressLoad();
            var isValid = $form.form('validate');
            if (!isValid) {
                progressClose();
                return isValid;
            }
            $.ajax({
                url: '/${model.modulePackage}/${model.modelL}/save',
                data: $form.serialize(),
                success: function(result){
                    progressClose();
                    if (result.success) {
                        parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                        parent.$.modalDialog.handler.dialog('close');
                    } else {
                        parent.$.messager.alert('提示', result.msg, 'warning');
                    }
                },
                error: function(){
                    progressClose();
                    alert("系统错误");
                }
            });
            return false;
        });
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
        <form id="modelForm" method="post">
            <table class="grid">
#foreach( $field in $fieldList )
#if( $field.isPk != "Y")
                    <tr>
#if( $field.type == "Date")
                        <td class="tdTit">#if(!$field.nullable)<strong class="red" >*</strong>#end<label>${field.comment}：</label></td>
                        <td><input id="" name="${field.field}" type="text" placeholder="点击选择时间" readonly="readonly" onfocus="WdatePicker();" th:value="${${model.modelL}.${field.field}}"/></td>
#else
                        <td class="tdTit">#if(!$field.nullable)<strong class="red" >*</strong>#end<label>${field.comment}：</label></td>
                        <td>
#if(${field.inputType}=="input")
                        <input type="text"  name="${field.field}"   class="easyui-validatebox" data-options="required:true" th:value="${${model.modelL}.${field.field}}"/>
#elseif(${field.inputType}=="hidden")
                        <input type="hidden"  name="${field.field}"   th:value="${${model.modelL}.${field.field}}"/>
#elseif(${field.inputType}=="textarea")
                        <textarea id="" name="${field.field}"  class="easyui-validatebox" data-options="required:true"  th:text="${${model.modelL}.${field.field}}"></textarea>
#elseif(${field.inputType}=="checkbox")
                        <input type="checkbox"  name="${field.field}"   th:value="${${model.modelL}.${field.field}}"/>
#elseif(${field.inputType}=="radio")
                        <input type="radio"  name="${field.field}"   th:value="${${model.modelL}.${field.field}}"/>
#elseif(${field.inputType}=="date")
                        <input id="" name="${field.field}" type="text" class="td_input require" readonly="readonly" onfocus="WdatePicker();" th:value="${${model.modelL}.${field.field}}"/>
#elseif(${field.inputType}=="file")
                        <input type="file"  name="${field.field}"   th:value="${${model.modelL}.${field.field}}"/>
#end
                        </td>
#end
                    </tr>
#end
#end
            </table>
            <input type="hidden" name="${pkField}" th:value="${${model.modelL}.${pkField}}"/>
            <input type="hidden" th:name="${_csrf.parameterName}"  th:value="${_csrf.token}"/>
        </form>
    </div>
</div>